package pta.MOOC.ch02.ex10;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] radii = new int[n];
        for (int i = 0; i < n; i++) {
            radii[i] = scanner.nextInt();
        }
        Arrays.sort(radii);
        System.out.println((Arrays.toString(radii)));
        for (int i = radii.length -1; i >=0 ; i--) {
            System.out.print((radii[i] + " "));
        }
        System.out.println();
        double sum = 0;
        for(int radius : radii){
            sum +=radius;
        }
        double average = sum / n;
        System.out.println(("平均半径=" + average));
        double Area = 0;
        for(int radius : radii){
            Area += Math.PI * radius * radius;
        }
        System.out.printf("总面积=%.6f\n", Area);
        scanner.close();
    }
}
